﻿{#if $T.d == null || $T.d[0] == null}
<div class="info">
    {BlogAdmin.i18n.noPackagesToDisplay}
</div>
{#else}
<ul class="gallery {$T.d[0].PackageType}">
    {#foreach $T.d as p}
        {#if $T.p.Location == "I"}
            <li class="pkg-installed">
        {#else}
            <li>
        {#/if}   
        <div class="{$T.p.PackageType}">
            <div class="pkg-hdr">
                <div class="pkg-img">
                    <img src="{$T.p.IconUrl}" class="thumbnail" alt="theme" />
                </div> 
                <div class="prop-hdr">
                    {#if $T.p.PackageUrl != null && $T.p.PackageUrl.length > 0}
                        <a href="{$T.p.PackageUrl}" target="_new">
                            <h2>{$T.p.Title}</h2>
                        </a>
                    {#else}
                        <h2>{$T.p.Title}</h2>
                    {#/if}
                    <!-- <p class="version">{BlogAdmin.i18n.version}: {$T.p.OnlineVersion}</p>-->
                    {#if $T.p.Website != null}
                        <p class="website">{BlogAdmin.i18n.author}: <a target="_new" href="{$T.p.Website}">{$T.p.Authors}</a></p> 
                    {#else}
                        <p>{BlogAdmin.i18n.author}: {$T.p.Authors}</p>
                    {#/if}
                    <p>{BlogAdmin.i18n.downloads}: {$T.p.DownloadCount}</p>
                    {#if $T.p.Location == "G"}
                    <p id="p_{$T.p.Id}">
                        <a href="" id="a-{$T.p.Id}" class="newAction" onclick="InstallPackage('{$T.p.Id}'); return false;">{BlogAdmin.i18n.install}</a>
                    </p>
                    {#else}
                        {#if $T.p.UpdateAvailable}
                            <p id="upd-{$T.p.Id}" class="package-update">
                                <a href="" onclick="UpdatePackage('{$T.p.Id}','G'); return false;">{BlogAdmin.i18n.update}</a>
                            </p>
                        {#else}
                            <p class="package-installed" style="float: none">
                                {BlogAdmin.i18n.installed}
                            </p>
                        {#/if}
                    {#/if}
                </div>  
            </div>  
        </div>        
    </li>
    {#/for}
</ul>
{#/if}